use actix_web::{error, web, App, FromRequest, HttpResponse, HttpServer};
use mall_mysql::db_source;
mod router_service;
use mall_servant::ResponseEntity;

#[actix_rt::main]
async fn main() -> std::io::Result<()> {
    let system = actix_rt::System::new("test");
    db_source::init_mysql_ds();

    println!("kotlinmall start");
    HttpServer::new(
        || App::new().configure(router_service::brand_router::config_service),
    )
        //  service(router_service::brand_router::select_by_id)
        //  data(router_service::brand_router::select_by_id_error_response())
        //  service(router_service::brand_router::insert)
        //  data(router_service::brand_router::insert_error_response())
    .bind("127.0.0.1:8088")?
        //.run()
        //.await
        .start();
    //    actix_rt::System::current().stop();
    system.run()
}
